/*
 * @(#)UsfExceptionInterceptorImpl.java $version 2010. 8. 11
 *
 * Copyright 2007-2010 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nhncorp.usf.core.interceptor.impl;

import com.nhncorp.lucy.web.interceptor.AbstractInterceptor;

import com.opensymphony.xwork.ActionInvocation;

/**
 * Exception을 처리하는 Interceptor
 * <p/>
 * 현재는 specification이 미정리 되어서 mockup으로만 구현. 향후에 보완이 필요
 *
 * @author Web Platform Development Team
 */
public class UsfExceptionInterceptorImpl extends AbstractInterceptor {
    private static final long serialVersionUID = 130520394512522125L;

	/**
	 * @param actionInvocation the ActionInvocation
	 * @return the interceptor result
	 * @throws Exception for Exception
	 */
	@Override
	public String intercept(ActionInvocation actionInvocation) throws Exception {

		String resultString;

		try {
			resultString = actionInvocation.invoke();
        } catch (Exception e) {
            resultString = e.getMessage();
        }

        return resultString;
    }

}
